package com.exercise.practice2;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserTest {
    public static void main(String[] args){
        //加载UserTest配置文件
        ApplicationContext context;
        context = new ClassPathXmlApplicationContext("User.xml");
        User welcome = (User) context.getBean("user1");
        welcome.show();
        ((AbstractApplicationContext)context).close();
    }
}
